(function() {
    angular.module('app').factory('tableShopComponentService', tableShopComponentService);

    tableShopComponentService.$inject = ['util','$q'];

    function tableShopComponentService(util,$q) {
        return {
            getShopDetail: _getShopDetail,
            getBrandProdsDetail: _getBrandProdsDetail
        }

        function _getShopDetail(json) {
        	var defer = $q.defer();
            util.$get({
                url: '/marketconditions/product/getShopProducts.htm',
                data: json
            }).then(function(resp) {
            	defer.resolve(resp.value);
            }, function(err) {
            	defer.resolve(err);
            });

            return defer.promise;
        }

        function _getBrandProdsDetail(json){
            var defer = $q.defer();
            util.$get({
                url: '/marketconditions/product/getBrandProduct.htm',
                data: json
            }).then(function(resp) {
                defer.resolve(resp.value);
            }, function(err) {
                defer.resolve(err);
            });

            return defer.promise;
        }
    }
})();
